package gdut.edu.demo02;

/**
 * @Description 循环链表测试类
 * @Author JiaFu
 * @Date 2022/9/5 21:26
 */
public class TestMyLoopNode {
    public static void main(String[] args) {
        MyLoopNode node1 = new MyLoopNode(1);
        MyLoopNode node2 = new MyLoopNode(2);
        MyLoopNode node3 = new MyLoopNode(3);
        MyLoopNode node4 = new MyLoopNode(4);
        System.out.println("-----------------");
        System.out.println(node1.getData());
        System.out.println(node1.next().getData());
        System.out.println("-----------------");
        node1.insert(node2);
        node2.insert(node3);
        node3.insert(node4);
        System.out.println(node1.next().getData());
        System.out.println(node2.next().getData());
        System.out.println(node3.next().getData());
        System.out.println(node4.next().getData());
        System.out.println("-----------------");
        node4.removeNext();
        System.out.println(node4.getData());
        System.out.println(node4.next().getData());
        System.out.println("-----------------");
        MyLoopNode node5 = new MyLoopNode(5);
        node5.removeNext();


    }
}
